//
//  OuptTopView.m
//  掌上宏力
//
//  Created by admin on 2017/5/10.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "OuptTopView.h"
#import "OuptMainModel.h"

#define LabFont 14
#define Lab_W 65
#define TextFont 15
#define DesFont 14
#define Text_W (kScreenW-295)
#define Text_H 30

@interface OuptTopView ()

@property (nonatomic,weak) UILabel *visitNoLab;
@property (nonatomic,weak) UILabel *doctorLab;
@property (nonatomic,weak) UILabel *departmentLab;
@property (nonatomic,weak) UILabel *sickDesLab;
@property (nonatomic,weak) UILabel *doctorDesLab;


@end
@implementation OuptTopView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
      
        //编号
        UILabel *visitNoL = [Factory createLabelWithTitle:@"就诊编号:" frame:CGRectMake(10, 5, Lab_W, Text_H) fontSize:LabFont];
        [self addSubview:visitNoL];
        
        UILabel *visitNoLab = [[UILabel alloc] initWithFrame:CGRectMake(visitNoL.right, 5, Lab_W-15, Text_H)];
        visitNoLab.font = kFont(TextFont);
        [self addSubview:visitNoLab];
        self.visitNoLab = visitNoLab;
        //医生
        UILabel *doctorL = [Factory createLabelWithTitle:@"医生:" frame:CGRectMake(visitNoLab.right, 5, 35, Text_H) fontSize:LabFont];
        [self addSubview:doctorL];
        
        UILabel *doctorLab = [[UILabel alloc] initWithFrame:CGRectMake(doctorL.right, 5, Lab_W, Text_H)];
        doctorLab.font = kFont(TextFont);
        [self addSubview:doctorLab];
        self.doctorLab = doctorLab;
        
        //科室
        UILabel *departmentL = [Factory createLabelWithTitle:@"科室:" frame:CGRectMake(doctorLab.right, 5, 35, Text_H) fontSize:LabFont];
        [self addSubview:departmentL];
        
        UILabel *departmentLab = [[UILabel alloc] initWithFrame:CGRectMake(departmentL.right, 5, Lab_W+30, Text_H)];
        departmentLab.font = kFont(TextFont);
        [self addSubview:departmentLab];
        self.departmentLab = departmentLab;
        
        //病人描述
        UILabel *sickDesL = [Factory createLabelWithTitle:@"病情描述:" frame:CGRectMake(10, visitNoLab.bottom, Lab_W, Text_H) fontSize:LabFont];
        [self addSubview:sickDesL];
        
        UILabel *sickDesLab = [[UILabel alloc] initWithFrame:CGRectMake(sickDesL.right, visitNoLab.bottom, kScreenW-105, Text_H)];
        sickDesLab.font = kFont(DesFont);
        sickDesLab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:sickDesLab];
        self.sickDesLab = sickDesLab;
        
        //医生诊断
        UILabel *doctorDesL = [Factory createLabelWithTitle:@"诊断结果:" frame:CGRectMake(10, sickDesLab.bottom, Lab_W, Text_H) fontSize:LabFont];
        [self addSubview:doctorDesL];
        UILabel *doctorDesLab = [[UILabel alloc] initWithFrame:CGRectMake(doctorDesL.right, sickDesLab.bottom, kScreenW-105, 30)];
        doctorDesLab.font = kFont(DesFont);
        doctorDesLab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:doctorDesLab];
        self.doctorDesLab = doctorDesLab;
        
        UIView *line = [Factory createViewWithBackgroundColor:[UIColor lightGrayColor] frame:CGRectMake(10, doctorDesLab.bottom, kScreenW-20, 1)];
        [self addSubview:line];
    }
    return self;
}
-(void)setModel:(OuptMainModel *)model{
    self.visitNoLab.text = model.visitNo;
    self.doctorLab.text = model.doctor;
    self.departmentLab.text = model.department;
    self.sickDesLab.text = model.sickDes;
    self.doctorDesLab.text = model.doctorDes;
}

@end
